package services;


import domain.entities.InvestigadorProtocoloCentro;
import domain.entities.Traductor;

import java.util.List;

public class CriteriaTranslator extends Criteria{

    private Traductor translator;

    public CriteriaTranslator(Traductor translator) {
        this.translator = translator;
    }

    @Override
    public boolean isIn(Object element){
        boolean isIn = true;

        Traductor other = (Traductor)element;


        isIn &= isSubstring(translator.getName(),other.getName());
        isIn &= isSubstring(translator.getSurname(),other.getSurname());
        isIn &= isSubstring(translator.getTranslationCompany(),other.getTranslationCompany());
        isIn &= isSubstring(translator.getContact(),other.getContact());
        isIn &= isSubstring(translator.getPhone(),other.getPhone());
        isIn &= isSubstring(translator.getMobilePhone(),other.getMobilePhone());
        isIn &= isSubstring(translator.getEmail(),other.getEmail());
        isIn &= isSubstring(translator.getAddress().getAddress(),other.getAddress().getAddress());
        isIn &= isSubstring(translator.getAddress().getCity(),other.getAddress().getCity());
        isIn &= isSubstring(translator.getAddress().getProvince(),other.getAddress().getProvince());
        isIn &= isSubstring(translator.getAddress().getCountry(),other.getAddress().getCountry());



        return isIn;
    }
}
